API: Remove gtk_render_frame_gap()
authorBenjamin Otte <otte@redhat.com>
Tue, 24 Jul 2018 17:38:17 +0000 (19:38 +0200)
committerBenjamin Otte <otte@redhat.com>
Tue, 24 Jul 2018 18:55:45 +0000 (20:55 +0200)
That function does not make sense at all in a CSS world. So better don't
support it anymore.

docs/reference/gtk/gtk4-sections.txt
gtk/gtkrender.c
gtk/gtkrender.h

index 021d4cbda896bb841994fb4e1312213c760423b6..f035fe37cb1da549f22b346ea0e0f6fe35242bf3 100644 (file)
@@ -4907,7 +4907,6 @@ gtk_render_check
 gtk_render_expander
 gtk_render_focus
 gtk_render_frame
-gtk_render_frame_gap
 gtk_render_handle
 gtk_render_layout
 gtk_render_line
index 0481d677568af228b526d8ad52d046382de7706f..6272a74ac341ce038fe3352a04903abb9692e0a5 100644 (file)
@@ -508,131 +508,6 @@ gtk_render_line (GtkStyleContext *context,
   gtk_do_render_line (context, cr, x0, y0, x1, y1);
 }
 
-static void
-gtk_css_style_render_frame_gap (GtkCssStyle     *style,
-                                cairo_t         *cr,
-                                gdouble          x,
-                                gdouble          y,
-                                gdouble          width,
-                                gdouble          height,
-                                GtkPositionType  gap_side,
-                                gdouble          xy0_gap,
-                                gdouble          xy1_gap)
-{
-  gint border_width;
-  gdouble x0, y0, x1, y1, xc = 0.0, yc = 0.0, wc = 0.0, hc = 0.0;
-  GtkBorder border;
-
-  border.top = _gtk_css_number_value_get (gtk_css_style_get_value (style, GTK_CSS_PROPERTY_BORDER_TOP_WIDTH), 100);
-  border.right = _gtk_css_number_value_get (gtk_css_style_get_value (style, GTK_CSS_PROPERTY_BORDER_RIGHT_WIDTH), 100);
-  border.bottom = _gtk_css_number_value_get (gtk_css_style_get_value (style, GTK_CSS_PROPERTY_BORDER_BOTTOM_WIDTH), 100);
-  border.left = _gtk_css_number_value_get (gtk_css_style_get_value (style, GTK_CSS_PROPERTY_BORDER_LEFT_WIDTH), 100);
-
-  border_width = MIN (MIN (border.top, border.bottom),
-                      MIN (border.left, border.right));
-
-  cairo_save (cr);
-
-  switch (gap_side)
-    {
-    case GTK_POS_TOP:
-      xc = x + xy0_gap + border_width;
-      yc = y;
-      wc = MAX (xy1_gap - xy0_gap - 2 * border_width, 0);
-      hc = border_width;
-      break;
-
-    case GTK_POS_BOTTOM:
-      xc = x + xy0_gap + border_width;
-      yc = y + height - border_width;
-      wc = MAX (xy1_gap - xy0_gap - 2 * border_width, 0);
-      hc = border_width;
-      break;
-
-    case GTK_POS_LEFT:
-      xc = x;
-      yc = y + xy0_gap + border_width;
-      wc = border_width;
-      hc = MAX (xy1_gap - xy0_gap - 2 * border_width, 0);
-      break;
-
-    case GTK_POS_RIGHT:
-      xc = x + width - border_width;
-      yc = y + xy0_gap + border_width;
-      wc = border_width;
-      hc = MAX (xy1_gap - xy0_gap - 2 * border_width, 0);
-      break;
-
-    default:
-      g_assert_not_reached ();
-      break;
-    }
-
-  cairo_clip_extents (cr, &x0, &y0, &x1, &y1);
-  cairo_rectangle (cr, x0, y0, x1 - x0, yc - y0);
-  cairo_rectangle (cr, x0, yc, xc - x0, hc);
-  cairo_rectangle (cr, xc + wc, yc, x1 - (xc + wc), hc);
-  cairo_rectangle (cr, x0, yc + hc, x1 - x0, y1 - (yc + hc));
-  cairo_clip (cr);
-
-  gtk_css_style_render_border (style, cr,
-                               x, y, width, height);
-
-  cairo_restore (cr);
-}
-
-/**
- * gtk_render_frame_gap:
- * @context: a #GtkStyleContext
- * @cr: a #cairo_t
- * @x: X origin of the rectangle
- * @y: Y origin of the rectangle
- * @width: rectangle width
- * @height: rectangle height
- * @gap_side: side where the gap is
- * @xy0_gap: initial coordinate (X or Y depending on @gap_side) for the gap
- * @xy1_gap: end coordinate (X or Y depending on @gap_side) for the gap
- *
- * Renders a frame around the rectangle defined by (@x, @y, @width, @height),
- * leaving a gap on one side. @xy0_gap and @xy1_gap will mean X coordinates
- * for %GTK_POS_TOP and %GTK_POS_BOTTOM gap sides, and Y coordinates for
- * %GTK_POS_LEFT and %GTK_POS_RIGHT.
- *
- * Typical rendering of a frame with a gap:
- *
- * ![](frame-gap.png)
- **/
-void
-gtk_render_frame_gap (GtkStyleContext *context,
-                      cairo_t         *cr,
-                      gdouble          x,
-                      gdouble          y,
-                      gdouble          width,
-                      gdouble          height,
-                      GtkPositionType  gap_side,
-                      gdouble          xy0_gap,
-                      gdouble          xy1_gap)
-{
-  g_return_if_fail (GTK_IS_STYLE_CONTEXT (context));
-  g_return_if_fail (cr != NULL);
-  g_return_if_fail (xy0_gap <= xy1_gap);
-  g_return_if_fail (xy0_gap >= 0);
-
-  if (width <= 0 || height <= 0)
-    return;
-
-  if (gap_side == GTK_POS_LEFT ||
-      gap_side == GTK_POS_RIGHT)
-    g_return_if_fail (xy1_gap <= height);
-  else
-    g_return_if_fail (xy1_gap <= width);
-
-  gtk_css_style_render_frame_gap (gtk_style_context_lookup_style (context),
-                                  cr,
-                                  x, y, width, height, gap_side,
-                                  xy0_gap, xy1_gap);
-}
-
 /**
  * gtk_render_handle:
  * @context: a #GtkStyleContext
index 938212f3406e96d50c15c24a43c30bf24369f87e..65390dc1011d1952f2cc32e46384a7517f8ea10c 100644 (file)
@@ -111,16 +111,6 @@ void        gtk_render_slider      (GtkStyleContext     *context,
                                     gdouble              height,
                                     GtkOrientation       orientation);
 GDK_AVAILABLE_IN_ALL
-void        gtk_render_frame_gap   (GtkStyleContext     *context,
-                                    cairo_t             *cr,
-                                    gdouble              x,
-                                    gdouble              y,
-                                    gdouble              width,
-                                    gdouble              height,
-                                    GtkPositionType      gap_side,
-                                    gdouble              xy0_gap,
-                                    gdouble              xy1_gap);
-GDK_AVAILABLE_IN_ALL
 void        gtk_render_handle      (GtkStyleContext     *context,
                                     cairo_t             *cr,
                                     gdouble              x,